package com.yan.demo.loopdemo;

/*
    分钟  剩水
    1     0
    2     0
    3     0
    4     1
    5     3
    6     6
    7     10
*/
public class Test14 {
    public static void main(String[] args) {
        int min = 0;
        // 定义进水体积和出水体积和灌水速度
        int water = 0;
        // 死循环while语句等水桶满了break跳出循环
        while (water < 10) {
            min++;
            water += min - 3;
            if (water < 0) {
                water = 0;
            }
        }
        System.out.println(min);
    }
}
